package day0411;

import java.util.Random;
import java.util.Scanner;

public class Test10 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入班级人数:");
        int classSize = scanner.nextInt();
        int[] grades = new int[classSize];
        Random random = new Random();
        int failCount = 0;
        int totalScore = 0;
        for (int i = 0; i < classSize; i++) {
            grades[i] = random.nextInt(101);
            if (grades[i] < 60) {
                failCount++;
            }
            totalScore += grades[i];
        }
        double averageScore = (double) totalScore / classSize;
        System.out.println("不及格人数:" + failCount);
        System.out.printf("班级平均分:%.0f\n", averageScore);
    }
}    